package com.jason.cloud.controller;

import com.jason.cloud.entity.User;
import com.jason.cloud.feign.UserProviderFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by RenJian on 2017/11/16.
 */
@RestController
public class ConsumerController {
    @Autowired
    private UserProviderFeignClient userProviderFeignClient;

    @GetMapping("/movie/{id}")
    public User findById(@PathVariable Long id) {
        return this.userProviderFeignClient.findById(id);
    }

    @GetMapping("/test")
    public User testPost(User user) {
        return this.userProviderFeignClient.postUser(user);
    }

}
